package net.wofly.sale.exchange.dao.impl;

import net.wofly.sale.exchange.dao.IExchangeStockDao;
import net.wofly.sale.exchange.domain.ExchangeStock;
import net.wofly.sale.exchange.repository.ExchangeStockRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ExchangeStockDaoImpl implements IExchangeStockDao {

	@Autowired
	ExchangeStockRepository repository;

	@Override
	public ExchangeStock save(ExchangeStock entity) {
		return repository.save(entity);
	}

	@Override
	public void delete(ExchangeStock entity) {
		repository.delete(entity);
	}

	@Override
	public void delete(String key) {
		repository.delete(key);
	}

	@Override
	public ExchangeStock findOne(String key) {
		return repository.findOne(key);
	}

	@Override
	public List<ExchangeStock> save(List<ExchangeStock> entityList) {
		return (List<ExchangeStock>) repository.save(entityList);
	}

}
